package Java8_26;

public class Pilot {
    private String name;
    public void driver(Plane1 Plane1) {
        if (Plane1 instanceof Zhandouji){
            System.out.println(name+"驾驶战斗机"+"，重量"+Plane1.getWeight()+"，飞行距离"+Plane1.getHeight());
        }else {
            System.out.println(name+"驾驶客机"+"，重量"+Plane1.getWeight()+"，飞行距离"+Plane1.getHeight());
        }
    }

    public Pilot(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
